<?php
/**
 * Created by PhpStorm.
 * User: 王 朋
 * Date: 2018/4/10
 * Time: 17:56
 */
namespace application\teacher\controller;
use application\common\controller\Base;
use think\Controller;
use application\common\model\Exam;
use think\Session;

class Index extends Base
{
    public function index() {
        $exam = new Exam();
        $exams = $exam->where('exam_creator_id',Session::get('userId'))->paginate(Session::get('pageNum'));
        $this->assign([
            'title' => '教师主页',
            'messageCount' => 0,
            'exams' => $exams,
            'alert' => $exams ? 'hidden' : 'show',
            'table' => $exams ? 'inline' : 'hidden',
        ]);
        return $this->fetch();
    }
}